<?php if (!defined('THINK_PATH')) exit();?><!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no">  
    <title>意见反馈</title>
    <link rel="stylesheet" href="/Public/Home/css/member.css">
    <!--不识别数字为手机-->
<meta name="format-detection" content="telephone=no, email=no"/>
<!--通用js-->
<?php if(isset($signPackage) && !empty($signPackage)){ ?>
<script type="text/javascript" src="http://res.wx.qq.com/open/js/jweixin-1.2.0.js?v=201704270010"></script>
<?php } ?>
<script type="text/javascript" src="/Public/Home/js/require.js"></script>
<script type="text/javascript" src="/Public/Home/js/baseLoading.js?v=201705240001"></script>
<script src="/Public/Home/js/jquery.min.js" ></script>
<script src="/Public/Home/js/pincode-input.js" ></script>
<script src="/Public/Home/js/parabola.js" ></script>
<script src="/Public/Home/js/lazyload/jquery.lazyload.min.js"></script>
<script type="text/javascript">
    _global.isLogin = !!"<?php echo $wx_member_id; ?>";
	var isWxShareDiy = typeof yc_share_diy === "undefined" ? false : yc_share_diy;
	var yc_wx_shareImgPath = "";
	<?php if(isset($weixin_logo) && !empty($weixin_logo)){ ?>
		yc_wx_shareImgPath = "/Uploads/<?php echo ($weixin_logo["image"]); ?>";
	<?php } ?>
    var yc_pass_arr = {'local_id':"<?php echo I('local_id',1);?>",'top_local_id':"<?php echo I('top_local_id',1);?>"};
	if(parseInt(yc_pass_arr["local_id"]) == 21){
		_global.isStopSell = true;
	}
    <?php if(isset($signPackage) && !empty($signPackage)){ ?>
        _global.isWeiXinLoad = true;
        var isEnableLocation = typeof yc_wx_location === "undefined" ? false : yc_wx_location;
        var yc_wx_options = {
            "enableLocation" : isEnableLocation,
            "refuseCallback" : function(){},
            "mapCallback" : function(){},
            "config" : {
                debug: false,
                appId: '<?php echo $signPackage["appId"];?>',
                timestamp: '<?php echo $signPackage["timestamp"];?>',
                nonceStr: '<?php echo $signPackage["nonceStr"];?>',
                signature: '<?php echo $signPackage["signature"];?>',
                jsApiList: [
                    'checkJsApi'
                ]
            }
        };
        var isInHeader = typeof yc_wx_useInHeader === "undefined" ? true : yc_wx_useInHeader;
        if(isInHeader){
            wxAutoConfig(yc_wx_options);
        }
    <?php } ?>
</script>
</head>
<body style="background:white;">
	<div class="warp">
        <form action="<?php echo url('Member/doMemberMyFeedback');?>" method="post" accept-charset="UTF-8" class="form-horizontal" pjax-container="">
            <div class="feedback">
                <p>我们知道怡臣还不太成熟，还有许多需要改进的地方，所以需要您来吐槽帮助我们发现问题。您的意见是我们前进的动力^_^</p>
                <textarea name="comment" id="comment" placeholder="请输入您的反馈意见"></textarea>
                <p>输入你的手机号，我们将第一时间给你反馈。</p>
                <input type="number" name="mobile" id="mobile" value="<?php echo ($mobile); ?>" placeholder="手机号码">
                <p><div class="btn btn-second btn-block" onclick="ajax_sub();">提交</div></p>
            </div>
        </form>
	</div>
    <script type="text/javascript">
		require(['memberMyfeedback']);
        var _isAjaxIdUpload = false;
        function ajax_sub() {
            if(_isAjaxIdUpload) {
                return;
            }
            _isAjaxIdUpload = true;

            var _data;
            var comment = $('#comment').val();
            var mobile = $('#mobile').val();
            _data = {"comment" : comment, "mobile" : mobile};
            $.ajax({
                type:'post',
                url:"<?php echo url('Member/doMemberMyFeedback');?>",
                dataType: 'json',
                data:_data ,
                success:function(rs){
                    _global.promote.alertPopup(rs);
                    if(rs== '1'){
                        _global.promote.alertPopup('您的建议我们已收到！');
                        setTimeout(function(){
                            window.location.href = "<?php echo url('Member/index');?>";
                        },2000);
                    }else {
                        _global.promote.alertPopup('请输入完整信息！');
                    }
                    _isAjaxIdUpload = false;
                },
                error:function(){
                    _isAjaxIdUpload = false;
                    _global.promote.alertPopup('服务器异常请稍后重试！');
                }
            })
        }
	</script>
</body>
</html>